package com.reggie.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.reggie.pojo.Dish;
import com.reggie.pojo.Setmeal;
import com.reggie.pojo.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishDao extends BaseMapper<SetmealDish> {

    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId};")
    void deleteBySetmealId(Long setmealId);


    @Select("select * from setmeal_dish where setmeal_id = #{setmealId};")
    List<SetmealDish> selectBySetmealId(Long setmealId);

    @Select("select * from setmeal_dish where dish_id=#{dishId};")
    List<SetmealDish> selectByDishId(@Param("dishId") Long dishId);
}
